<?php

namespace App\CustomTrait;

use Illuminate\Support\Facades\Session;

trait VerificationTrait
{
  /**
   * 登录密码验证
   * @param $checkPwd
   * @param $member
   * @return bool
   */
  public function isCheckPassword($checkPwd, $member)
  {
    //验证密码
    if (\Illuminate\Support\Facades\Hash::check($checkPwd, $member->password)) {
      return false;
    } else {
      return true;
    }
  }

  /**
   * 验证码验证
   * @param $code
   * @return bool
   */
  public function isCheckCode($code)
  {
    return Session::get('codes') !== $code ? true : false;
  }
}